package com.xlh.dao.support.helper;

import com.xlh.dao.support.StatisticsMapper;
import com.xlh.pojo.support.Statistics;
import com.xlh.pojo.support.StatisticsExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author sy
 */
@Repository
public class StatisticsMapperHelper {

    @Autowired
    private StatisticsMapper statisticsMapper;


    public List<Statistics> findByCondition(Long userId, Long courseId, Long classId) {

        StatisticsExample example = new StatisticsExample();
        example.createCriteria().andUserIdEqualTo(userId).andCourseIdEqualTo(courseId).andClassIdEqualTo(classId);
        List<Statistics> statistics = statisticsMapper.selectByExample(example);

        return statistics;
    }
}
